package com.huike.web.controller.clues;


import com.huike.clues.domain.TbClueTrackRecord;
import com.huike.clues.domain.vo.ClueTrackRecordVo;
import com.huike.clues.service.ITbClueService;
import com.huike.common.core.controller.BaseController;
import com.huike.common.core.domain.AjaxResult;
import com.huike.common.core.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/clues/record")
public class TbClueTrackRecordController extends BaseController {

    @Autowired
    private ITbClueService tbClueService;



    @PostMapping
    public AjaxResult insertTbClueTrackRecord(@RequestBody ClueTrackRecordVo vo) {
        int row = tbClueService.insertTbClueTrackRecord(vo);
        return toAjax(row);
    }

    @GetMapping("/list")
    public TableDataInfo list(@RequestParam("clueId") String clueId) {
        List<TbClueTrackRecord> list =  tbClueService.getClueTrackRecordList(clueId);
        return getDataTable(list);
    }
}
